<?php

declare(strict_types=1);

namespace app\shop\controller\admin\data;

use sheep\controller\Backend;
use app\shop\model\data\Page as PageModel;
use sheep\controller\traits\Crud;

class Page extends Backend
{
    use Crud;
    protected $model = null;
    protected $isPaginate = true;
    protected $onlyParams = ['name', 'path', 'group'];

    public function initialize()
    {
        $this->model = new PageModel();
    }

    public function select()
    {
        $data = $this->model->group('group')->with(['children'])->field('group')->select();
        return success('操作成功', $data);
    }
}
